<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
    <title>ИС "Аттестация рабочих мест"</title>
    <link rel="stylesheet" type="text/css" href="/arm/resources/css/style.css">
</head>
<body>


<f:view>
    <a4j:form id="frm" ajaxSubmit="true">

        <%@ include file="/pages/common/menu.jsp" %>

        <h:panelGrid columns="3">

            <h:outputText id="usLoginLbl" value="Логин"/>
            <h:inputText id="usLoginTxt" value="#{usersBean.users.login}" maxlength="100"/>
            <rich:message for="usLoginTxt" styleClass="error" />

            <h:outputText id="usPasLbl" value="Пароль"/>
            <h:inputSecret id="usPasTxt" required="true" value="#{usersBean.users.password}"/>
            <rich:message for="usPasTxt" styleClass="error" />

            <h:outputText id="usSurLbl" value="Фамилия"/>
            <h:inputText id="usSurTxt" required="true" value="#{usersBean.users.surname}" maxlength="50"/>
            <rich:message for="usSurTxt" styleClass="error" />

            <h:outputText id="usFirnLbl" value="Имя"/>
            <h:inputText id="usFirnTxt" required="true" value="#{usersBean.users.firstname}" maxlength="50"/>
            <rich:message for="usFirnTxt" styleClass="error" />

            <h:outputText id="usPatLbl" value="Отчество"/>
            <h:inputText id="usPatTxt" required="true" value="#{usersBean.users.patronymic}" maxlength="50"/>
            <rich:message for="usPatTxt" styleClass="error" />

            <h:outputText id="usRoleLbl" value="Роль"/>
            <h:selectOneMenu id="usRoleSom" value="#{usersBean.users.role}"  required="true">
                <f:selectItem itemLabel="Пользователь" itemValue="ROLE_USER"/>
                <f:selectItem itemLabel="Администрирование" itemValue="ROLE_ADMIN"/>
            </h:selectOneMenu>
            <rich:message for="usRoleSom" styleClass="error" />

        </h:panelGrid>

        <h:panelGrid id="pnlButtonsRows" columns="2">
            <a4j:commandButton id="btnSave" action="#{usersBean.save}" value="Сохранить"/>
            <a4j:commandButton id="btnCancel" action="#{usersBean.cancel}" immediate="true" value="Отмена"/>
        </h:panelGrid>
    </a4j:form>
</f:view>
</body>
</html>